//- Copyright (C) 2023 Beijing Huaxia Chunsong Technology Co., Ltd. 
//- <https://www.chatopera.com>, Licensed under the Chunsong Public 
//- License, Version 1.0  (the "License"), https://docs.cskefu.com/licenses/v1.html
//- Unless required by applicable law or agreed to in writing, software
//- distributed under the License is distributed on an "AS IS" BASIS,
//- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//- See the License for the specific language governing permissions and
//- limitations under the License.
//- Copyright (C) 2018-Jun. 2023 Chatopera Inc, <https://www.chatopera.com>
//- Licensed under the Apache License, Version 2.0
//- http://www.apache.org/licenses/LICENSE-2.0
extends /admin/include/layout.pug
block content
    .row
        .col-lg-12
            h1.site-h1(style='background-color:#FFFFFF;')
                | #{sysDic.name} 分类模板
                span(style='float:right;')
                    button.layui-btn.layui-btn-small.green(href='/admin/template/add.html?type=' + sysDic.id, data-toggle='ajax', data-width='700', data-height='350', data-title='创建新模板')
                        | 创建新模板

            .row(style='padding:5px;')
                .col-lg-12
                    table.layui-table(lay-skin='line')
                        colgroup
                            col(width='15%')
                            col(width='20%')
                            if sysDic.ctype == "layout"
                                col(width="10%")
                            col(width='10%')
                            col(width='1%')
                            col
                        thead
                            tr
                                th 模板名称
                                th 创建时间
                                if sysDic.ctype == "layout"
                                    th 列数
                                th 模板内容
                                th(style='white-space:nowrap;', nowrap) 操作
                        tbody
                            for template in templateList
                                tr
                                    td: a(href="/admin/template/code.html?type="+sysDic.id+"&id="+template.id, data-width="750", data-height="450", data-toggle="ajax", title="编辑"+template.name)
                                    if template.createtime
                                        td= pugHelper.formatDate('yyyy-MM-dd HH:mm:ss', template.createtime)
                                    else
                                        td
                                    if sysDic.ctype == "layout"
                                        td= template.layoutcols
                                    if template.templettext
                                        i.layui-icon(style="color:#19a55d;") &#xe618;
                                    else
                                        td
                                    td(style="white-space:nowrap;" nowrap="nowrap")
                                        a(href="/admin/template/edit.html?type="+sysDic.id+"&id="+template.id, data-width="750" data-height="350" data-toggle="ajax" title="编辑"+template.name)
                                            i.layui-icon &#xe642;
                                            span 编辑
                                        a(href="/admin/template/delete.html?templettype="+sysDic.id+"&id=" +template.id, data-toggle="tip" data-title="请确认是否系统模板“"+template.name+"”？")
                                            i.layui-icon(class="layui-icon") &#x1006;
                                            span 删除
